home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / text / cmanual.lzh / ACM3.lzh / AmigaDOS / Example4.c < prev    next >
C/C++ Source or Header  |  1991-01-12  |  850b  |  35 lines

  1. /* Example 4                                                         */
  2. /* This example demonstrates how to delete files and directories. It */
  3. /* will delete the file Example 1 and directory Example 2 created.   */
  4. /* (The file and directory are supposed to have been renamed by      */
  5. /* Example 3.)                                                       */
  6.  
  7.  
  8. /* This file declares the type BOOL: */
  9. #include <exec/types.h>
  10.  
  11.  
  12. void main();
  13.  
  14. void main()
  15. {
  16.   BOOL ok;
  17.  
  18.  
  19.   /* Delete the file: */
  20.   ok = DeleteFile( "RAM:Numbers.dat" );
  21.  
  22.   /* Check if the file was successfully deleted: */
  23.   if( !ok )
  24.     printf( "The file could not be deleted!\n" );
  25.  
  26.  
  27.   /* Delete the directory: */
  28.   ok = DeleteFile( "RAM:NewDirectory" );
  29.  
  30.   /* Check if the directory was successfully deleted: */
  31.   if( !ok )
  32.     printf( "The directory could not be deleted!\n" );
  33. }
  34.  
  35.